The present invention relates to the matching of digital images, and more particularly to high precision sub-pixel spatial alignment of digital images.
Accurate spatial alignment of digital images is of fundamental importance to many applications. One such application is the determination of picture quality using an instrument, such as the PQA200 Picture Quality Analyzer manufactured by Tektronix, Inc. of Beaverton Oreg., USA, where images from a reference video signal are compared with corresponding images from a test video signal that is a processed version of the reference video signal. The better the spatial alignment between a reference image and a corresponding test image, the more accurate the determination of the amount of degradation of the test video signal due to the processing.
At pages 480-484 of Computer Image Processing and Recognition (1979) published by Academic Press, Ernest L. Hall describes a basic correlator method for template matching, which may be used for image alignment. Likewise J. J. Pearson et al in an article entitled Video-Rate Image Correlation Processor (IOCC 1997) published in SPIE Vol. 119 Application of Digital Image Processing, pages 197-205, describe a variant of the basic correlator method that uses phase information. For digital images with integer pixel shifts these correlation methods may be very accurate. However for a broader class of shifts, which involves both integer and fractional pixel shifts, the precision of the sub-pixel alignment becomes a very serious matter. Pearson et al describe a method for estimating the sub-pixel shifts by quadratic interpolation using the correlation values in the neighborhood of a peak. However, since the quadratic interpolation function does not necessarily match the true image shifting function, the accuracy obtained by the quadratic interpolation is limited.
What is desired is a high precision sub-pixel spatial alignment of digital images.
Accordingly the present invention provides for high precision sub-pixel spatial alignment of digital images using an iteration method and spatial resampling. A high precision sub-pixel spatial alignment of digital images, one from a reference video signal and another from a corresponding test video signal, uses an iterative process and incorporates spatial resampling along with basic correlation and estimation of fractional pixel shift. The corresponding images from the reference and test video signals are captured and a test block is overlaid on them at the same locations to include texture from the images. FFTs are performed within the test block in each image, and the FFTs are cross-correlated to develop a peak value representing a shift position between the images. A curve is fitted to the peak and neighboring values to find the nearest integer pixel shift position. The test block is shifted in the test image by the integer pixel shift position, and the FFT in the test image is repeated and correlated with the FFT from the reference image. The curve fitting is repeated to obtain a fractional pixel shift position value that is combined with the integer pixel shift value to update the test block position again in the test image. The steps are repeated until an end condition is achieved, at which point the value of the pixel shift position for the test block in the test image relative to the reference image is used to align the two images with high precision sub-pixel accuracy.
The objects, advantages and other novel features of the present invention are apparent from the following detailed description when read in conjunction with the appended claims and attached drawing.